Respect pre-set env vars and add cgroup memory detection in env scripts#17765
Open
MileaRobertStefan wants to merge 3 commits into
Open
Respect pre-set env vars and add cgroup memory detection in env scripts#17765MileaRobertStefan wants to merge 3 commits into
MileaRobertStefan wants to merge 3 commits into
Conversation
2 tasks
CRZbulabula
reviewed
May 26, 2026
Contributor
CRZbulabula
left a comment
There was a problem hiding this comment.
Thanks for tackling this — JVM auto-sizing in containers reading host memory is a real and well-known footgun, and the cgroup v1/v2 dual handling here is the right shape. A few inline suggestions below; nothing blocking. Two file-level notes:
- No automated tests. Cgroup-gated shell behavior is awkward to unit-test, but a small harness that parameterizes the cgroup mount point (default
/sys/fs/cgroup) and runs the function against fixture files would catch regressions cheaply. Acceptable to skip given the PR description confirms manual cluster verification. - Duplication. The same ~17-line block is copy-pasted across
confignode-env.shanddatanode-env.sh. The existingcalculate_memory_sizes()is already duplicated in both files, so this is consistent with the current style — but a follow-up that sources a shared helper fromscripts/conf/iotdb-common.shwould reduce drift. - AINode unaffected, right?
scripts/sbin/start-ainode.shis Python-based and presumably doesn't share this Bash sizing machinery — worth confirming so nobody assumes container-aware sizing applies there too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds cgroup v1/v2 memory detection.
This PR has:
for an unfamiliar reader.
for code coverage.